package synology;

import javax.swing.filechooser.FileSystemView;

import synology.ui.ApplicationFrame;

public class SynoApp
{
	//--------------------------------------------------------------------------------------------
	public static void main(String[] args)
	{
		ApplicationFrame frame = new ApplicationFrame();
		frame.setVisible(true);
	}


	//--------------------------------------------------------------------------------------------
	public static boolean isWindows()
	{
		String osName = System.getProperty("os.name").toLowerCase();
		return (osName.indexOf("win") != -1);
	}


	//--------------------------------------------------------------------------------------------
	public static boolean isMac()
	{
		String osName = System.getProperty("os.name").toLowerCase();
		return (osName.indexOf("mac") != -1);
	}


	//--------------------------------------------------------------------------------------------
	public static String getApplicationDirectory()
	{
		String settingDirs = null;
		if (isWindows())
		{
			settingDirs = System.getProperty("user.home");
			settingDirs += "\\Application Data\\SynologySharing\\";
		}
		else if (isMac())
		{
			settingDirs = FileSystemView.getFileSystemView().getHomeDirectory().getAbsolutePath();
			settingDirs += "/Library/SynologySharing/";
		}

		return settingDirs;
	}


	//--------------------------------------------------------------------------------------------
	public static String getSeparator()
	{
		return System.getProperty("file.separator");
	}
}
